<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      li{
        list-style: none;
        height: 30px;
        width: 40px;
        cursor: pointer;
        margin: auto;
        display: inline-block;
        background-color: pink;
      }
     </style>
</head>
<body>
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
    </ul>

    <script>
        var oli = document.getElementsByTagName('li')
        for(var i=0;i<oli.length;i++) {
            // 鼠标进入事件
            oli[i].onmouse = function(){
                this.style.height = '100px'
                this.style.transition = 'all 0.2s'
            }
            // 鼠标离去事件
            oli[i].onmouseleave = function(){
                this.style.height = '30px'
                this.style.transiton = 'all 0.2s'
            }
        }
    </script>
</body>

<script>
  
</script>
</html>